package com.my.attendance.service;

import com.my.attendance.dao.BuMenDao;
import com.my.attendance.entity.Department;

import java.sql.SQLException;
import java.util.List;

public class BuMenService {
    private BuMenDao buMenDao=new BuMenDao();
    public List<Department> list() throws Exception {
        return buMenDao.list();
    }

    public void add(Department d) throws Exception {
        buMenDao.add(d);
    }

    public void del(String department_number) throws Exception {
        buMenDao.del(department_number);
    }

    public void update(Department d) throws Exception {
        buMenDao.update(d);
    }

    public Department getBuMen(String department_number) throws Exception {
        return buMenDao.getBuMen(department_number);
    }

    public int addBuMenPre() throws SQLException {
        String s = buMenDao.addBuMenPre();
        return Integer.parseInt(s);
    }
}
